package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.utils.UserThreadLocal;
import com.zzyl.framework.web.service.TokenService;
import io.jsonwebtoken.Claims;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("member/reservation")
public class MemberReservationController {
    @Autowired
    private TokenService tokenService;
    @GetMapping("/cancelled-count")
    //authorization: eyJhbGciOiJIUzUxMiJ9.eyJpZCI6Mn0.6HxtkZqo6sg6RW1KoADXx3_bsYACJ8YeCDDbSIaJfenLirorFlT8UGO78y688Gv67N0pOrvrzsaoxQC0_t_rpA
    public AjaxResult cancelledCount(@RequestHeader("authorization")String token){
        Claims claims = tokenService.parseToken(token);
        claims.get("id",Long.class);
        Long userId = UserThreadLocal.getUserId();
        return AjaxResult.success();
    }
}
